home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
util
/
time
/
DRemind.lha
/
DRemind
/
MReminder
/
MRemind-GUI
/
Deutsch
/
MRemind-GUI.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
2000-08-06
|
7KB
|
278 lines
/* $VER: MRemind-GUI.rexx 1.0a (06-Aug-2000) von A.Greve */
mrname = 'C:MicroReminder'
editorname = 'CED:ED'
editoropt = ' -s'
/**************************************/
prefsfile = 'MRemind-GUI.cfg'
tempfile = 'T:MRemind-GUI.tmp'
tab = '09'x
qu = '22'x
lf = '0a'x
wintags2 = ''
wt_flag = 0
rt_flag = 1
timer = 0
appname = 'MRemind-GUI'
applongname = 'MRemind-GUI - ©2000 von Axel Greve'
appinfo = 'GUI für MicroReminder 1.1+ by Deniil715!'
appversion = '1.0a'
apprelease = '2'
appdate = '06-Aug-2000'
IF ~SHOW('LIBRARIES','tritonrexx.library') THEN DO
IF ~ADDLIB('tritonrexx.library',10,-30,0) THEN DO
SAY 'Kann die <tritonrexx.library> nicht öffnen!'
EXIT(10)
END
END
IF ~SHOW('LIBRARIES','rexxtricks.library') THEN DO
IF ~ADDLIB('rexxtricks.library',10,-30,0) THEN rt_flag = 0
END
SIGNAL ON break_c
SIGNAL ON failure
SIGNAL ON halt
SIGNAL ON ioerr
SIGNAL ON syntax
wintags1 = WindowID(100),
WindowTitle(appname appversion),
WindowPosition('TRWP_CENTERDISPLAY'),
'VertGroupA' 'SpaceB'
wintags3 = 'HorizGroupAC' 'Space',
TextID(" _Stunden",1) 'SpaceS' SliderGadget(0,23,0,1) 'Space',
'EndGroup' 'Space',
'HorizGroupAC' 'Space',
TextID(" _Minuten",3) 'SpaceS' SliderGadget(0,59,1,3) 'Space',
'EndGroup' 'Space',
'HorizGroupAC' 'Space',
TextID("Se_kunden",5) 'SpaceS' SliderGadget(0,59,0,5) 'Space',
'EndGroup' 'SpaceB',
'HorizSeparator' 'SpaceB',
'HorizGroupC' 'Space',
ButtonR(" Start ",98) 'SpaceB',
'GroupBox',
'HorizGroup' 'SpaceS',
TextID('00',2) 'TRAT_MinWidth 2' TextN(':'),
TextID('01',4) 'TRAT_MinWidth 2' TextN(':'),
TextID('00',6) 'TRAT_MinWidth 2' 'SpaceS',
'EndGroup' 'SpaceB',
Button("Abbruch",99) 'Space',
'EndGroup' 'SpaceB',
'EndGroup',
'EndProject'
_ReadPrefs()
IF wt_flag THEN
wintags2 = 'HorizGroupAC' 'Space',
Button("_Prefs",12) 'SpaceS',
ListSS('pref',11,0,0) 'TRAT_MinWidth' minwid 'TRAT_MinHeight' 3 'Space',
'EndGroup' 'SpaceB'
app = TR_CREATEAPP('TRCA_Name' '"'appname'"',
'TRCA_LongName' '"'applongname'"',
'TRCA_Info' '"'appinfo'"',
'TRCA_Version' '"'appversion'"',
'TRCA_Release' '"'apprelease'"',
'TRCA_Date' '"'appdate'"',
'TAG_END')
IF app ~= '00000000'x THEN DO
window = TR_OPENPROJECT(app,wintags1' 'wintags2' 'wintags3)
IF window ~= '00000000'x THEN DO
lock = C2D(window)
ende = 0
DO WHILE ende ~= 1
CALL TR_WAIT(app,'')
DO WHILE TR_HANDLEMSG(app,'event')
IF event.trm_class = 'TRMS_NEWVALUE' THEN DO
SELECT
WHEN event.trm_id = 1 THEN _NewVal(2,0)
WHEN event.trm_id = 3 THEN _NewVal(4,0)
WHEN event.trm_id = 5 THEN _NewVal(6,0)
WHEN event.trm_id = 11 THEN DO
IF BITAND(D2X(event.trm_qualifier),'0200'x) = '0200'x THEN
_StartTimer()
ELSE DO
data = event.trm_data
TR_SetAttribute(window,1,'TRAT_Disabled',(data ~= 0))
TR_SetAttribute(window,3,'TRAT_Disabled',(data ~= 0))
TR_SetAttribute(window,5,'TRAT_Disabled',(data ~= 0))
IF data = 0 THEN DO
_NewVal(2,1)
_NewVal(4,3)
_NewVal(6,5)
END
ELSE DO
data = data + 1
timer = timer.data
TR_SetAttribute(window,2,'TRAT_Text',th.data)
TR_SetAttribute(window,4,'TRAT_Text',tm.data)
TR_SetAttribute(window,6,'TRAT_Text',ts.data)
END
END
END
WHEN event.trm_id = 12 THEN _EditPrefs()
OTHERWISE
NOP
END
END
IF event.trm_class = 'TRMS_ACTION' THEN DO
SELECT
WHEN event.trm_id = 12 THEN _EditPrefs()
WHEN event.trm_id = 98 THEN _StartTimer()
WHEN event.trm_id = 99 THEN ende = 1
OTHERWISE
NOP
END
END
IF event.trm_class = 'TRMS_CLOSEWINDOW' THEN ende = 1
END
END
CALL TR_CLOSEPROJECT(window)
END
CALL TR_DELETEAPP(app)
END
EXIT(0)
/**************************************/
_NewVal:
PARSE ARG obj,obj1
IF obj1 = 0 THEN tmp = event.trm_data
ELSE tmp = TR_GetAttribute(window,obj1,'TRAT_Value')
TR_SetAttribute(window,obj,'TRAT_Text',RIGHT('0'tmp,2))
timer = TR_GetAttribute(window,1,'TRAT_Value') * 3600 + TR_GetAttribute(window,3,'TRAT_Value') * 60 + TR_GetAttribute(window,5,'TRAT_Value')
RETURN 0
_StartTimer:
IF OPEN('fname',mrname,'R') THEN DO
CLOSE('fname')
ADDRESS COMMAND 'Run >NIL: 'mrname timer' NOSAVE'
ende = 1
END
ELSE _EasyReq(mrname)
RETURN 0
_EditPrefs:
IF OPEN('fname',editorname,'R') THEN DO
CLOSE('fname')
ADDRESS COMMAND editorname''editoropt' ENV:'prefsfile
DROP dummy.
IF OPEN('fname','ENVARC:'prefsfile,'R') THEN DO
CLOSE('fname')
ADDRESS COMMAND 'Compare >'tempfile' ENV:'prefsfile' ENVARC:'prefsfile
IF RXTR_READFILE(tempfile, dummy) THEN DO
IF dummy.0 ~= 0 THEN DO
ADDRESS COMMAND 'Copy >NIL: ENV:'prefsfile' ENVARC:'
_ReadPrefs()
TR_SetAttribute(window,11,'TROB_Listview',pref)
TR_SetAttribute(window,11,'TRLV_Top',0)
TR_SetAttribute(window,11,'TRAT_Value',0)
TR_SetAttribute(window,1, 'TRAT_Disabled',0)
TR_SetAttribute(window,3, 'TRAT_Disabled',0)
TR_SetAttribute(window,5, 'TRAT_Disabled',0)
_NewVal(2,1)
_NewVal(4,3)
_NewVal(6,5)
END
END
END
ELSE ADDRESS COMMAND 'Copy >NIL: ENV:'prefsfile' ENVARC:'
ADDRESS COMMAND 'Delete >NIL: 'tempfile
END
ELSE _EasyReq(editorname)
RETURN 0
_ReadPrefs:
IF rt_flag THEN DO
DROP pref. prefs.
IF RXTR_READFILE('ENV:'prefsfile,'prefs') THEN DO
wt_flag = 1
pref.0 = 1
pref.1 = 'Manuell'
minwid = LENGTH(pref.1)
j = 1
DO i = 1 TO prefs.0
temp = TRANSLATE(prefs.i,' ',tab)
temp = STRIP(temp)
IF LEFT(temp,1) ~= ';' & WORDS(temp) > 0 THEN DO
temp1 = WORD(temp,1)
temp2 = RIGHT(temp,LENGTH(temp) - WORDINDEX(temp,2) + 1)
IF (LEFT(temp2,1) = qu) & (RIGHT(temp2,1) = qu) THEN
temp2 = CENTER(temp2,LENGTH(temp2) - 2)
IF LENGTH(temp1) = 5 | LENGTH(temp1) = 8 THEN DO
IF SUBSTR(temp1,3,1) = ':' THEN DO
IF SUBSTR(temp1,6,1) = ':' THEN DO
th = LEFT(temp1,2)
tm = SUBSTR(temp1,4,2)
ts = RIGHT(temp1,2)
END
ELSE DO
th = '00'
tm = LEFT(temp1,2)
ts = SUBSTR(temp1,4,2)
END
IF DATATYPE(th''tm''ts) = 'NUM' THEN DO
DROP temp1
temp1 = th * 3600 + tm * 60 + ts
_TakeOver()
END
END
END
ELSE DO
IF DATATYPE(temp1) = 'NUM' THEN _TakeOver()
END
END
END
minwid = minwid + 1
END
END
RETURN 0
_TakeOver:
IF (temp1 > -1) & (temp1 < 86400) THEN DO
j = j + 1
timer.j = temp1
rest1 = temp1 // 3600
th.j = RIGHT('0'temp1 % 3600,2)
rest2 = rest1 // 60
tm.j = RIGHT('0'rest1 % 60,2)
ts.j = RIGHT('0'rest2,2)
pref.j = temp2
minwid = MAX(minwid,LENGTH(temp2))
pref.0 = j
END
RETURN 0
_EasyReq:
PARSE ARG argum
CALL TR_EASYREQUEST(app,'Konnte »'argum'« nicht finden!',' O K ',,
'TREZ_Title' "MRemind-GUI"'a0'x"Meldung...",
'TREZ_LockProject' lock 'TAG_END')
RETURN 0
break_c:
failure:
halt:
ioerr:
syntax:
SAY '+++ Fehler' rc 'in Zeile' sigl '-' ERRORTEXT(rc)
SAY SOURCELINE(sigl)
IF app ~= '00000000'x THEN CALL TR_DELETEAPP(app)
EXIT(10)